<?php

/**
 * This is the model class for table "sekolahmuridgurusmknegri".
 *
 * The followings are the available columns in table 'sekolahmuridgurusmknegri':
 * @property integer $smgsmkn_id
 * @property integer $smgsmkn_kec
 * @property integer $smgsmkn_jmlsekolah
 * @property integer $smgsmkn_jmlmurid
 * @property integer $smgsmkn_jmlguru
 * @property integer $smgsmkn_tahun
 *
 * The followings are the available model relations:
 * @property Kecamatan $smgsmknKec
 */
class Sekolahmuridgurusmknegri extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Sekolahmuridgurusmknegri the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'sekolahmuridgurusmknegri';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('smgsmkn_kec, smgsmkn_jmlsekolah, smgsmkn_jmlmurid, smgsmkn_jmlguru, smgsmkn_tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('smgsmkn_id, smgsmkn_kec, smgsmkn_jmlsekolah, smgsmkn_jmlmurid, smgsmkn_jmlguru, smgsmkn_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'smgsmknKec' => array(self::BELONGS_TO, 'Kecamatan', 'smgsmkn_kec'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'smgsmkn_id' => 'Smgsmkn',
			'smgsmkn_kec' => 'Smgsmkn Kec',
			'smgsmkn_jmlsekolah' => 'Smgsmkn Jmlsekolah',
			'smgsmkn_jmlmurid' => 'Smgsmkn Jmlmurid',
			'smgsmkn_jmlguru' => 'Smgsmkn Jmlguru',
			'smgsmkn_tahun' => 'Smgsmkn Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('smgsmkn_id',$this->smgsmkn_id);
		$criteria->compare('smgsmkn_kec',$this->smgsmkn_kec);
		$criteria->compare('smgsmkn_jmlsekolah',$this->smgsmkn_jmlsekolah);
		$criteria->compare('smgsmkn_jmlmurid',$this->smgsmkn_jmlmurid);
		$criteria->compare('smgsmkn_jmlguru',$this->smgsmkn_jmlguru);
		$criteria->compare('smgsmkn_tahun',$this->smgsmkn_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}